package com.ruoyi.base.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BasHydrologyMapper;
import com.ruoyi.base.domain.BasHydrology;
import com.ruoyi.base.service.IBasHydrologyService;

/**
 * 水文站Service业务层处理
 * 
 * @author maliang
 * @date 2025-07-27
 */
@Service
public class BasHydrologyServiceImpl implements IBasHydrologyService 
{
    @Autowired
    private BasHydrologyMapper basHydrologyMapper;

    /**
     * 查询水文站
     * 
     * @param id 水文站主键
     * @return 水文站
     */
    @Override
    public BasHydrology selectBasHydrologyById(String id)
    {
        return basHydrologyMapper.selectBasHydrologyById(id);
    }

    /**
     * 查询水文站列表
     * 
     * @param basHydrology 水文站
     * @return 水文站
     */
    @Override
    public List<BasHydrology> selectBasHydrologyList(BasHydrology basHydrology)
    {
        return basHydrologyMapper.selectBasHydrologyList(basHydrology);
    }

    /**
     * 新增水文站
     * 
     * @param basHydrology 水文站
     * @return 结果
     */
    @Override
    public int insertBasHydrology(BasHydrology basHydrology)
    {
        basHydrology.setId(UUID.randomUUID().toString());
        basHydrology.setUpdatedate(DateUtils.getNowDate());
        return basHydrologyMapper.insertBasHydrology(basHydrology);
    }

    /**
     * 修改水文站
     * 
     * @param basHydrology 水文站
     * @return 结果
     */
    @Override
    public int updateBasHydrology(BasHydrology basHydrology)
    {
        basHydrology.setUpdatedate(DateUtils.getNowDate());
        return basHydrologyMapper.updateBasHydrology(basHydrology);
    }

    /**
     * 批量删除水文站
     * 
     * @param ids 需要删除的水文站主键
     * @return 结果
     */
    @Override
    public int deleteBasHydrologyByIds(String[] ids)
    {
        return basHydrologyMapper.deleteBasHydrologyByIds(ids);
    }

    /**
     * 删除水文站信息
     * 
     * @param id 水文站主键
     * @return 结果
     */
    @Override
    public int deleteBasHydrologyById(String id)
    {
        return basHydrologyMapper.deleteBasHydrologyById(id);
    }
}
